/* Ensure canvas fills the window and style control panel */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  overflow: hidden;
  font-family: sans-serif;
}

#counters {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  color: white;
  font-weight: bold;
}

#counters div {
  margin-bottom: 5px;
  background: rgba(0, 0, 0, 0.7);
  padding: 5px 10px;
  border-radius: 5px;
}

#controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
  border-radius: 8px;
  max-height: 90vh;
  overflow-y: auto;
  width: 240px;
}

#controls > div {
  margin-bottom: 10px;
}

/* Updated sort panel style */
#sortPanel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  padding: 5px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  z-index: 10;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
}

#sortPanel button {
  background-color: #fff;
  border: 1px solid #ddd;
  color: #333;
  padding: 4px 8px;
  margin: 1px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: background-color 0.2s;
  flex: 0 1 auto;
  min-width: 80px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  height: 22px;
  line-height: 12px;
}

#sortPanel button:hover {
  background-color: #f0f0f0;
  border-color: #999;
}

#sortPanel #stopButton {
  background-color: #ff4444;
  color: white;
  border-color: #cc0000;
}

#sortPanel #stopButton:hover {
  background-color: #cc0000;
}

canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}